
<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%@ page language="java" import='java.util.ArrayList'%>
<%@ page language="java" import='java.util.List'%>
<%@ page language="java" import='com.dgac.licencias.to.*'%>
<%@ page language="java" import='java.text.DecimalFormat'%>

<html><head><title>LISTADO DE CLIENTES</title>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<link href="/WebLicencias/css/espacio.css" type="text/css" rel="stylesheet">
<link href="/WebLicencias/css/calendar-system.css" type="text/css" rel="stylesheet">
<script language="javascript" src="/WebLicencias/js/calendar.js"></script>
<script language="javascript" type="text/javascript" src="/WebLicencias/js/js.Farmacia.Function.js"></script>
<script language="javascript" src="/WebLicencias/js/calendar-es.js"></script>
<script language="javascript" src="/WebLicencias/js/utils.js"></script>
<script language="javascript">
setResizableElements('res');
    function validarMenu(menu){
        if(menu=="1"){
		   document.frmCliente.submit();
        }else{
        	   document.getElementById('idTabla2').style.display="none"; 
		   document.getElementById('idTabla1').style.display="inline"; 
        }
    }
     function ExportarXLS(){
       document.frmCliente.action="/WebLicencias/BuscarLicenciasVencidasXLS.do";
       document.forms["frmCliente"].submit(); 
    }
</script>

<meta content="MSHTML 6.00.6000.16939" name="GENERATOR"></head>
<body>
<table width="98%" align="center" bgcolor="#fffdd6" border="0">
    <form action="/WebLicencias/BuscarLicenciasVencidas.do" id="frmCliente" name="frmCliente">      
     <INPUT TYPE="HIDDEN" NAME="codcli" VALUE="0">
     <INPUT TYPE="HIDDEN" NAME="metodo" VALUE="buscar">   
  <tbody>
  <tr></tr>
  <tr></tr>
   <tr>
    <td>
      <div class="Titulo1B" align="center">CONSULTA DE VENCIMIENTO DE LICENCIAS</div></td></tr>
  <tr>
    <td>
      <fieldset class="TablaBorde">
      <table width="100%" align="center" border="0">
        <tbody>
        <tr>
          <td class="TituloAzulClaro" align="right" width="15%">No Licencia</td>
          <td width="21%"><input class="Campo" name="txtnumlic"
            width="140"> </td></tr>
        <tr>
          <td class="TituloAzulClaro" align="right">Cliente</td>
          <td><input class="Campo" style="WIDTH: 211px; HEIGHT: 15px" 
            size=37 name="txtnombre" width="140"></td></tr>
        <tr>
          <td class="TituloAzulClaro" align="right">Fecha Vencimiento Desde</td>
          <td><input class="Campo" value="" name="txtfecdesde" 
            width="140" id="txtfecdesde" ><input name="Submit322222" type="button" class="Boton2" value="..." onClick="return showCalendar('txtfecdesde','dd/mm/y');"></td></tr>
          
        <tr>
          <td class="TituloAzulClaro" align="right">Fecha Vencimiento Hasta</td>
          <td><input class="Campo" value="" name="txtfechasta" 
            width="140" id="txtfechasta"><input name="Submit322222" type="button" class="Boton2" value="..." onClick="return showCalendar('txtfechasta','dd/mm/y');"></td></tr></tbody></table></fieldset></td></tr>
  <script type="text/javascript">
  <!--
  var currentTime = new Date() 
  var pastTime=new Date()
  pastTime.setDate(currentTime.getDate()-7);
  var month = currentTime.getMonth() + 1
  var day = currentTime.getDate()
  var year = currentTime.getFullYear()
  document.frmCliente.txtfechasta.value= day+ "/" + month + "/" + year;
  
  month = pastTime.getMonth() + 1
  day = pastTime.getDate()
  year = pastTime.getFullYear()
  document.frmCliente.txtfecdesde.value= day+ "/" + month + "/" + year;
  //-->
  </script>  
  <tr>
    <td class="TextoPortal" align="middle" colspan="4"><input class="boton" onclick="validarMenu('1');" type="button" value="Buscar" name="Submit22">&nbsp; 
<input class="boton" type="reset" value="Limpiar" name="Submit22"></td></tr></tbody></table>
<div id="idTabla2" style="DISPLAY: inline">
<table width="98%" align="center" bgcolor="#fffdd6" border="0">
  <tbody>
  <tr>
    <td>
      <div id="res"> <br>
      <table class="consultanormal" id="row" cellspacing="0" width="98%" 
        align=center><thead>
        <tr>
          <th class="sortable" width="8%"><a href="#"><font color="#ffffff">No 
            Licencia</font></a></th>
          <th class="sortable" width="20%"><a href="#"><font 
            color=#ffffff>Tipo&nbsp;</font></a></th>
          <th class="sortable" width="10%"><a href="#"><font color="#ffffff">Fecha 
            Vencimiento</font></a></th>
          <th class="sortable" width="30%"><a href="#"><font 
            color=#ffffff>Cliente</font></a></th>
          <th class="sortable" width="10%"><a href="#"><font color="#ffffff">Fecha Otorg.</font></a></th>
          <th class="sortable" width="10%"><a href="#"><font color="#ffffff">No 
            Documento</font></a></th></tr></thead>
        <tbody>
            
         <%
           ArrayList listclilic = (ArrayList) request.getSession().getAttribute("listClienteLicencias2");
           int hits=0;
           if (listclilic!=null) {
           hits=listclilic.size(); 
           for (int i = 0; i < listclilic.size(); i++) {
                    ClientelicenciaTO clilic = (ClientelicenciaTO) listclilic.get(i);
                    String[] clase = {"odd","even"};
         %>
        
        <tr class="<%=(clase[i%2])%>">
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getNumLic() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getLicenciaTO().getDescripcion() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getFechaVcmnto() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getClienteTO().getNombreCompleto()  %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getSfechaOtorgamiento() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%=clilic.getClienteTO().getNumIdDoc() %></div></td></tr>
             <%
          }
        }
           if(hits==0){
            %>
            <tr class="odd">
          <td>
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
           </tr>
            <%}%>
            </tbody></table><br>
      
            <%if(hits!=0){%>
       <br>
       <div class="exportlinks">Exportar: <a 
      href="javascript:ExportarXLS();"><span 
      class="export excel">Excel </span></a></div>
       <%}%>  
          </div></td></tr></tbody></table></div>
<script language="javascript">
highlightTableRows('row');
</script>
</body></html>

